#pragma once
#include <windows.h>
#include <gdiplus.h>

using namespace Gdiplus;
#pragma comment (lib,"Gdiplus.lib")


const int PB_SPACE = 7;
const int PB_CUBE = 14;

class ProgressBar
{
private:
	HWND hWnd;
	int x, y, width, height;
	float progress; // 0 - 100

	bool updated;
	bool is_mouse_down;
	int lastMousePoint1, lastMousePoint2;
	int control_id;

public:
	ProgressBar(int x, int y, int width, int height, HWND hWnd, int control_id)
	{
		this->hWnd = hWnd;
		this->x = x;
		this->y = y;
		this->width = width;
		this->height = height;
		this->progress = 0;
		is_mouse_down = false;
		updated = false;
		this->control_id = control_id;
	}

	float setProgress(float p);
	float getProgress();

	void update();
	void draw(HDC hdc);

	void mouseDown();
	void mouseUp();

	int calculate();

};